package cn.bluethink.eguan.core.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import cn.bluethink.eguan.model.core.EgObject;

@Service
public class EgPosObjectService {
	static private Map<Integer,AEgPosObjectService> posObjectServices = new HashMap<>();
	
	synchronized static public void addPosObjectService(Integer otype, AEgPosObjectService posObjectService ) {
		posObjectServices.put(otype, posObjectService);
	}
	
	public EgObject pos(Integer otype, Long oid ) throws Exception {
		AEgPosObjectService posObjectService =  posObjectServices.get(otype);
		if ( posObjectService == null ) return null;
		else return posObjectService.pos(oid);
	}
}
